<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMessagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('messages', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('match_order_id')->coment('匹配单 ID');
            $table->text('message')->coment('留言内容');
            $table->enum('type',['withdraw','deposit','kefu'])->coment('withdraw入 deposit出 kefu客服');

            $table->unsignedBigInteger('created_at')->comment('留言时间');
            $table->unsignedBigInteger('updated_at')->comment('修改时间');
            //$table->unsignedBigInteger('delete_at')->comment('留言删除时间');

            $table->foreign('match_order_id')->references('id')->on('match_orders');

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('messages');
    }
}
